package nthu.web.view;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import nthu.web.model.domain.box.MemoBox;
import nthu.web.service.json.JsonService;



@SuppressWarnings("serial")
public class UserBoxJsonView extends ResourceView<MemoBox> {

    @Override
	public void doGet(HttpServletRequest request, HttpServletResponse response)
    										throws ServletException, IOException {

    	Object m = getModel(request); // m can be a Mail object or a list of Mail objects
		response.setContentType("application/json");
		response.setHeader("Cache-Control", "no-cache"); // make sure no intermediate node caches the result
		response.setCharacterEncoding("UTF-8");
		response.getWriter().print(JsonService.serialize(m));
	}
    
}

